package com.woniu.dao;

import com.woniu.dto.DynamicCommentDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DynamicCommentMapper {

    @Select("select pu.nickname nickName,cdc.id,cd.cd_type dynamicType,cd.cd_favor favor,cd.cd_content dynamicContent,cd.cd_time issueTime,cdc.cdc_content `comment`,cdc.cdc_time commentTime from person_user pu INNER JOIN community_dynamic_comment cdc ON pu.id = cdc.cdc_user_id INNER JOIN community_dynamic cd ON cdc.cdc_dynamic_id=cd.id order by cdc.id desc")
    List<DynamicCommentDTO> findByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);

    @Delete("delete from community_dynamic_comment where id = #{value}")
    void delComment(Integer id);

    List<DynamicCommentDTO> select(@Param("nickName") String nickName,@Param("dynamicType") Integer dynamicType);
}
